 <?php 
class PasswordComponent extends Object {
 
/**
 * Password generator function
 *
 */
    public function generatePassword ($length = 8){
        // inicializa variables
        $password = "";
        $i = 0;
        $possible = "0123456789bcdfghjkmnpqrstvwxyz"; 
        
        // agrega random
        while ($i < $length){
            $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
            
            if (!strstr($password, $char)) { 
                $password .= $char;
                $i++;
            }
        }
        return $password;
    }
	
	public function initialize(Controller $controller) {
	}
	
	public function startup(Controller $controller) {
	}
	
	public function beforeRender(Controller $controller) {
	}
	
	public function shutdown(Controller $controller) {
	}
	
	public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
	}
}
?>